<template>
  <div class="app-container">
    <div class="filter-container">
      <el-input
        v-model="listQuery.name"
        placeholder="项目名称"
        style="width: 200px"
        class="filter-item"
        @keyup.enter.native="handleFilter"
      />
      <el-input
        v-model="listQuery.name"
        placeholder="项目编号"
        style="width: 200px"
        class="filter-item"
        @keyup.enter.native="handleFilter"
      />
      <el-date-picker
        v-model="listQuery.publish_date"
        type="datetime"
        class="filter-item"
        placeholder="选择日期时间"
        style="width: 150px"
      />
      <el-date-picker
        v-model="listQuery.publish_date"
        type="datetime"
        class="filter-item"
        placeholder="报名截止时间"
        style="width: 150px"
      />
      <el-date-picker
        v-model="listQuery.publish_date"
        type="datetime"
        class="filter-item"
        placeholder="评标时间"
        style="width: 150px"
      />

      <el-date-picker
        v-model="listQuery.publish_date"
        type="datetime"
        class="filter-item"
        placeholder="投标截止时间"
        style="width: 150px"
      />
      <el-select
        v-model="listQuery.contract"
        class="filter-item"
        placeholder="联系人"
        style="width: 100px"
      >
        <el-option
          v-for="option in options"
          :label="option.label"
          :value="option.value"
          :key="option.value"
        ></el-option>
      </el-select>

      <el-button class="filter-item" type="primary" icon="el-icon-search">
        查询
      </el-button>
      <el-button class="filter-item" type="primary" icon="el-icon-refresh">
        重置
      </el-button>
      <el-button
        icon="el-icon-plus"
        type="success"
        class="filter-item"
        @click="goCreate"
        >新建招标项目</el-button
      >
    </div>
    <el-tabs v-model="activeName" type="card">
      <el-tab-pane label="全部" name="1"></el-tab-pane>
      <el-tab-pane label="待提交" name="2"></el-tab-pane>
      <el-tab-pane label="招标中" name="3"></el-tab-pane>
      <el-tab-pane label="开标中" name="4"></el-tab-pane>
      <el-tab-pane label="评标中" name="5"></el-tab-pane>
      <el-tab-pane label="定标中" name="6"></el-tab-pane>
      <el-tab-pane label="已完成" name="7"></el-tab-pane>
    </el-tabs>
    <el-table :data="list" border highlight-current-row>
      <el-table-column
        label="序号"
        type="index"
        width="60"
        align="center"
      ></el-table-column>
      <el-table-column
        prop="name"
        label="项目名称"
        width="260"
        show-overflow-tooltip
      ></el-table-column>
      <el-table-column label="招标方式" width="80"></el-table-column>
      <el-table-column label="手机号码" width="120"></el-table-column>
      <el-table-column
        prop="date"
        align="center"
        label="报名截止时间"
        width="150"
      ></el-table-column>
      <el-table-column
        prop="date"
        align="center"
        label="投标截止时间"
        width="150"
      ></el-table-column>
      <el-table-column
        prop="date"
        align="center"
        label="评标时间"
        width="150"
      ></el-table-column>
      <el-table-column prop="address" label="评标地址"></el-table-column>
      <el-table-column
        prop="status"
        label="状态"
        width="120"
        align="center"
      ></el-table-column>
      <el-table-column label="操作" width="200" align="center">
        <template slot-scope="scope">
          <div>
            <el-button type="text">查看</el-button>
            <el-button type="text">编辑</el-button>
            <el-button v-if="scope.row.status == '草稿'" type="text"
              >提交</el-button
            >
          </div>
        </template>
      </el-table-column>
    </el-table>
    <pagination
      :total="total"
      :page.sync="listQuery.page"
      :limit.sync="listQuery.limit"
      @pagination="getList"
    />
  </div>
</template>

<script>
import Pagination from "@/components/Pagination";
export default {
  name: "PurchaseIndex",
  data() {
    return {
      total: 0,
      list: [
        {
          date: "2016-05-02",
          name: "项目名称1",
          address: "上海市普陀区金沙江路 1518 弄",
          status: "草稿",
        },
        {
          date: "2016-05-04",
          name: "项目名称2",
          address: "上海市普陀区金沙江路 1517 弄",
          status: "审核中",
        },
        {
          date: "2016-05-01",
          name: "项目名称3",
          address: "上海市普陀区金沙江路 1519 弄",
          status: "审核不通过",
        },
        {
          date: "2016-05-03",
          name: "项目名称4",
          address: "上海市普陀区金沙江路 1516 弄",
          status: "发布招标预告",
        },
      ],
      listQuery: {
        page: 1,
        limit: 20,
        publish_date: undefined,
        name: undefined,
        contract: "",
        status: "1",
      },
      options: [],
      activeName: "1",
    };
  },
  components: {
    Pagination,
  },
  methods: {
    getList() {},
    handleFilter() {},
    goCreate() {
      this.$router.push({
        name: "BidCreate",
      });
    },
  },
};
</script>

<style lang="scss" scoped>
</style>